<?php

    class FeedController extends WebController
    {
        public function actionIndex()
        {   
            $title = 'Mới nhất';

            $criteria=new CDbCriteria;
            $criteria->order = "t.created DESC";
            $criteria->with = array('image', 'video', 'joke');

            $dataProvider = new CActiveDataProvider('Feed', array(
                'criteria'=>$criteria,
                'pagination' => array(
                    'pageSize' => 10,
                    'pageVar' => 'page',
                ),
            ));
            
            $this->pageTitle = "{$title} | ". $this->siteSlogan;
            
            $this->render('index', compact('dataProvider', 'title'));
        }
    }
